package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.MerchantMapper;
import com.ruoyi.system.domain.Merchant;
import com.ruoyi.system.service.IMerchantService;

/**
 * 商家Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-02-01
 */
@Service
public class MerchantServiceImpl implements IMerchantService 
{
    @Autowired
    private MerchantMapper merchantMapper;

    /**
     * 查询商家
     * 
     * @param mid 商家主键
     * @return 商家
     */
    @Override
    public Merchant selectMerchantByMid(Long mid)
    {
        return merchantMapper.selectMerchantByMid(mid);
    }

    /**
     * 查询商家列表
     * 
     * @param merchant 商家
     * @return 商家
     */
    @Override
    public List<Merchant> selectMerchantList(Merchant merchant)
    {
        return merchantMapper.selectMerchantList(merchant);
    }

    /**
     * 新增商家
     * 
     * @param merchant 商家
     * @return 结果
     */
    @Override
    public int insertMerchant(Merchant merchant)
    {
        return merchantMapper.insertMerchant(merchant);
    }

    /**
     * 修改商家
     * 
     * @param merchant 商家
     * @return 结果
     */
    @Override
    public int updateMerchant(Merchant merchant)
    {
        return merchantMapper.updateMerchant(merchant);
    }

    /**
     * 批量删除商家
     * 
     * @param mids 需要删除的商家主键
     * @return 结果
     */
    @Override
    public int deleteMerchantByMids(Long[] mids)
    {
        return merchantMapper.deleteMerchantByMids(mids);
    }

    /**
     * 删除商家信息
     * 
     * @param mid 商家主键
     * @return 结果
     */
    @Override
    public int deleteMerchantByMid(Long mid)
    {
        return merchantMapper.deleteMerchantByMid(mid);
    }
}
